import React, { Component, createRef } from 'react'
export default class App extends Component {
  myRef = createRef()
  myRef1 = createRef()
  showMyRef=()=>{
    alert(this.myRef.current.value)
  }
  render() {
    return (
      <div>
        <input ref={this.myRef}></input>
        <button onClick={this.showMyRef}>点击</button>
        <input onBlur={()=>{console.log(this.myRef1.current.value)}} ref={this.myRef1}/>
      </div>
    )
  }
}
